var logLevel = 0,
	LEVEL_DEBUG = 0,
	LEVEL_INFO = 1,
	LEVEL_WARN = 2,
	LEVEL_ERROR = 3,
	LEVEL_FAULT = 4;

var userAgent = navigator.userAgent.toLowerCase(),
	isFirefox = /firefox/.test(userAgent),
	isOpera   = /opera/.test(userAgent),
	isSafari  = /webkit/.test(userAgent),
	isIE      = /msie/.test(userAgent) && !/opera/.test(userAgent),
	isIE6     = /msie 6/i.test(navigator.appVersion),
	browserVersion = (userAgent.match( /.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [0,'0'])[1],
	isIElt8   = this.isIE && (this.browserVersion-0 < 8); 

function warn(msg, obj){
	if(logLevel>LEVEL_WARN)return;
	if(console){
		console.warn(msg,obj);
	}
}

function debug(msg, obj){
	if(logLevel>LEVEL_DEBUG)return;
	if(console){
		if(isIE){
			return;
		}else{
			console.debug(msg,obj);
		}
	}
}

function info(msg, obj){
	if(logLevel>LEVEL_INFO)return;
	if(console){
		if(isIE){
			return;
		}else{
			console.info(msg,obj);
		}
	}
}

function log(msg, obj){
	if(logLevel>LEVEL_INFO)return;
	if(console){
		if(isIE){
			return;
		}else{
			console.log(msg,obj);
		}
	}
}

function error(msg, obj){
	if(logLevel>LEVEL_ERROR)return;
	if(console){
		if(isIE){
			return;
		}else{
			console.error(msg, obj);
		}
	}
}